/**
  ******************************************************************************
  * @author     Chris
  * @since      2023/9/30 12:16
  *
  * @file       hd_oled.h
  * @brief      Head file of Xxx Hardware Driver.
  *
  * @note       This file contains the hardware driver's function declaration 
  *             for the Xxx.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date           Author       Notes
  *   2023/9/30     Chris        the first version
  *
  ******************************************************************************
  */

#ifndef JXTech_1OLED_H
#define JXTech_1OLED_H

#include "stm32g4xx.h"
#include "stm32g4xx_ll_gpio.h"

/**
 * The mode of the font displayed on the OLED.
 */
#define OLED_MODE_NEGATIVE  0   /* OLED negative display, light up the background. */
#define OLED_MODE_POSITIVE  1   /* OLED positive display, light up the content. */

/**
 * The size of the font displayed on the OLED.
 */
#define OLED_SIZE_12        12  /* The font display in OLED is width 6 px, height 12 px. */
#define OLED_SIZE_16        16  /* The font display in OLED is width 8 px, height 16 px. */
#define OLED_SIZE_24        24  /* The font display in OLED is width 12 px, height 24 px. */


void HD_OLED_Init(uint8_t size, uint8_t mode);

void HD_OLED_SetSize(uint8_t size);

void HD_OLED_SetMode(uint8_t mode);

void HD_OLED_Clear();

void HD_OLED_Full();

void HD_OLED_ShowChar(uint8_t x, uint8_t y, char chr);

void HD_OLED_ShowString(uint8_t x, uint8_t y, char *str);

void HD_OLED_ShowNum(uint8_t x, uint8_t y, uint32_t num, uint8_t len);

void HD_OLED_ShowSignedNum(uint8_t x, uint8_t y, int32_t num, uint8_t len);

void HD_OLED_ShowHexNum(uint8_t x, uint8_t y, uint32_t num, uint8_t len);

void HD_OLED_ShowBinNum(uint8_t x, uint8_t y, uint32_t num, uint8_t len);

void HD_OLED_RefreshGram(void);

#endif
